xen/arm64: cmpxchg: Simplify the cmpxchg implementation
authorJulien Grall <julien.grall@arm.com>
Wed, 22 May 2019 20:37:53 +0000 (13:37 -0700)
committerJulien Grall <julien.grall@arm.com>
Fri, 14 Jun 2019 13:38:40 +0000 (14:38 +0100)
commit5833f3fc33936d0d1c9d661ddb29ae7c970bd32c
treec347fd406879a18931c4700c96a265ac85797c4f
parent4fc7dd9f8cb7e1c8d288d7d2e39eeb46b76a6bde
xen/arm64: cmpxchg: Simplify the cmpxchg implementation

The only difference between each case of the cmpxchg is the size of
used. Rather than duplicating the code, provide a macro to generate each
cases.

This makes the code easier to read and modify.

This is part of XSA-295.

Signed-off-by; Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
xen/include/asm-arm/arm64/cmpxchg.h